//
//  HZWMovieModel.m
//  开心一刻
//
//  Created by lanou on 16/4/8.
//  Copyright © 2016年 刘洋. All rights reserved.
//

#import "HZWMovieModel.h"

@implementation HZWMovieModel
-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
+(NSMutableArray*)requestMovie:(NSDictionary *)dic
{
    NSMutableArray * array =[NSMutableArray array];
    NSDictionary * dataDic = dic[@"data"];
    NSArray * dataArray = dataDic[@"data"];
    for (NSDictionary * bigDic  in dataArray)
    {
        HZWMovieModel * model =[[HZWMovieModel alloc]init];
        
        NSArray * commentsArray = bigDic[@"comments"];
        
        if (commentsArray.count != 0 )
        {
            for (NSDictionary * dic  in commentsArray)
            {
                model.betterImage = dic[@"avatar_url"];
                model.BetterText = dic[@"text"];
                model.user_name = dic[@"user_name"];
            }
            
        }
        NSDictionary * groupDic = bigDic[@"group"];
        NSDictionary * Dic =groupDic[@"720p_video"];
        model.height =(int) Dic[@"height"];
        model.width = (int)Dic[@"width"];
        [model setValuesForKeysWithDictionary:groupDic];
        NSDictionary * userDic = groupDic[@"user"];
        
        [model setValuesForKeysWithDictionary:userDic];
        NSDictionary * large_coverDic = groupDic[@"large_cover"];
        NSArray * url_listArray =large_coverDic[@"url_list"];
        [model setValuesForKeysWithDictionary:url_listArray[0]];
       // NSLog(@"++++++%@",model.BetterText);
        
        [array addObject:model];
    }
    return array ;
    
}

@end
